<?php
/**
 * Created by PhpStorm.
 * 商家设置
 * User: caicm
 * Date: 2017/7/1
 * Time: 10:24
 */

namespace WMApi\Service;


class SellerSetService {

    /**
     * 检查提现密码
     * Created By caicm
     * @param string $action_withdraw_password 提交密码
     * @param string $seller_withdraw_password 数据库密码
     * @return bool
     */
    public function check_withdraw_password($action_withdraw_password='', $seller_withdraw_password=''){
        //密码加密
        $action_withdraw_password = $this->compile_withdraw_password($action_withdraw_password);
        if($seller_withdraw_password != $action_withdraw_password){
            returnApiError('提现密码不正确');
        }
        return true;
    }

    /**
     * 编译提现密码
     * Created By caicm
     * @param $withdraw_password
     */
    public function compile_withdraw_password($withdraw_password){
        return compile_password(array('password'=>$withdraw_password, 'ec_salt'=>C('withdraw_password_key')));
    }

}